/*
 * XML Type:  many-to-many
 * Namespace: http://java.sun.com/xml/ns/persistence/orm
 * Java type: com.googlecode.horncomb.orm.jpa.v10.xmlbeans.ManyToMany
 *
 * Automatically generated - do not modify.
 */
package com.googlecode.horncomb.orm.jpa.v10.xmlbeans.impl;
/**
 * An XML many-to-many(@http://java.sun.com/xml/ns/persistence/orm).
 *
 * This is a complex type.
 */
public class ManyToManyImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.googlecode.horncomb.orm.jpa.v10.xmlbeans.ManyToMany
{
    
    /**  */
	private static final long serialVersionUID = 3282044136096094989L;


	public ManyToManyImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ORDERBY$0 = 
        new javax.xml.namespace.QName("http://java.sun.com/xml/ns/persistence/orm", "order-by");
    private static final javax.xml.namespace.QName MAPKEY$2 = 
        new javax.xml.namespace.QName("http://java.sun.com/xml/ns/persistence/orm", "map-key");
    private static final javax.xml.namespace.QName JOINTABLE$4 = 
        new javax.xml.namespace.QName("http://java.sun.com/xml/ns/persistence/orm", "join-table");
    private static final javax.xml.namespace.QName CASCADE$6 = 
        new javax.xml.namespace.QName("http://java.sun.com/xml/ns/persistence/orm", "cascade");
    private static final javax.xml.namespace.QName NAME$8 = 
        new javax.xml.namespace.QName("", "name");
    private static final javax.xml.namespace.QName TARGETENTITY$10 = 
        new javax.xml.namespace.QName("", "target-entity");
    private static final javax.xml.namespace.QName FETCH$12 = 
        new javax.xml.namespace.QName("", "fetch");
    private static final javax.xml.namespace.QName MAPPEDBY$14 = 
        new javax.xml.namespace.QName("", "mapped-by");
    
    
    /**
     * Gets the "order-by" element
     */
    public java.lang.String getOrderBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ORDERBY$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "order-by" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy xgetOrderBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy)get_store().find_element_user(ORDERBY$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "order-by" element
     */
    public boolean isSetOrderBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ORDERBY$0) != 0;
        }
    }
    
    /**
     * Sets the "order-by" element
     */
    public void setOrderBy(java.lang.String orderBy)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ORDERBY$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ORDERBY$0);
            }
            target.setStringValue(orderBy);
        }
    }
    
    /**
     * Sets (as xml) the "order-by" element
     */
    public void xsetOrderBy(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy orderBy)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy)get_store().find_element_user(ORDERBY$0, 0);
            if (target == null)
            {
                target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.OrderBy)get_store().add_element_user(ORDERBY$0);
            }
            target.set(orderBy);
        }
    }
    
    /**
     * Unsets the "order-by" element
     */
    public void unsetOrderBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ORDERBY$0, 0);
        }
    }
    
    /**
     * Gets the "map-key" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey getMapKey()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey)get_store().find_element_user(MAPKEY$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "map-key" element
     */
    public boolean isSetMapKey()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAPKEY$2) != 0;
        }
    }
    
    /**
     * Sets the "map-key" element
     */
    public void setMapKey(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey mapKey)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey)get_store().find_element_user(MAPKEY$2, 0);
            if (target == null)
            {
                target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey)get_store().add_element_user(MAPKEY$2);
            }
            target.set(mapKey);
        }
    }
    
    /**
     * Appends and returns a new empty "map-key" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey addNewMapKey()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.MapKey)get_store().add_element_user(MAPKEY$2);
            return target;
        }
    }
    
    /**
     * Unsets the "map-key" element
     */
    public void unsetMapKey()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAPKEY$2, 0);
        }
    }
    
    /**
     * Gets the "join-table" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable getJoinTable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable)get_store().find_element_user(JOINTABLE$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "join-table" element
     */
    public boolean isSetJoinTable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(JOINTABLE$4) != 0;
        }
    }
    
    /**
     * Sets the "join-table" element
     */
    public void setJoinTable(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable joinTable)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable)get_store().find_element_user(JOINTABLE$4, 0);
            if (target == null)
            {
                target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable)get_store().add_element_user(JOINTABLE$4);
            }
            target.set(joinTable);
        }
    }
    
    /**
     * Appends and returns a new empty "join-table" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable addNewJoinTable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.JoinTable)get_store().add_element_user(JOINTABLE$4);
            return target;
        }
    }
    
    /**
     * Unsets the "join-table" element
     */
    public void unsetJoinTable()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(JOINTABLE$4, 0);
        }
    }
    
    /**
     * Gets the "cascade" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType getCascade()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType)get_store().find_element_user(CASCADE$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "cascade" element
     */
    public boolean isSetCascade()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CASCADE$6) != 0;
        }
    }
    
    /**
     * Sets the "cascade" element
     */
    public void setCascade(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType cascade)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType)get_store().find_element_user(CASCADE$6, 0);
            if (target == null)
            {
                target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType)get_store().add_element_user(CASCADE$6);
            }
            target.set(cascade);
        }
    }
    
    /**
     * Appends and returns a new empty "cascade" element
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType addNewCascade()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.CascadeType)get_store().add_element_user(CASCADE$6);
            return target;
        }
    }
    
    /**
     * Unsets the "cascade" element
     */
    public void unsetCascade()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CASCADE$6, 0);
        }
    }
    
    /**
     * Gets the "name" attribute
     */
    public java.lang.String getName()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$8);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "name" attribute
     */
    public org.apache.xmlbeans.XmlString xgetName()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$8);
            return target;
        }
    }
    
    /**
     * Sets the "name" attribute
     */
    public void setName(java.lang.String name)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$8);
            }
            target.setStringValue(name);
        }
    }
    
    /**
     * Sets (as xml) the "name" attribute
     */
    public void xsetName(org.apache.xmlbeans.XmlString name)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(NAME$8);
            }
            target.set(name);
        }
    }
    
    /**
     * Gets the "target-entity" attribute
     */
    public java.lang.String getTargetEntity()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGETENTITY$10);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "target-entity" attribute
     */
    public org.apache.xmlbeans.XmlString xgetTargetEntity()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGETENTITY$10);
            return target;
        }
    }
    
    /**
     * True if has "target-entity" attribute
     */
    public boolean isSetTargetEntity()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(TARGETENTITY$10) != null;
        }
    }
    
    /**
     * Sets the "target-entity" attribute
     */
    public void setTargetEntity(java.lang.String targetEntity)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGETENTITY$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TARGETENTITY$10);
            }
            target.setStringValue(targetEntity);
        }
    }
    
    /**
     * Sets (as xml) the "target-entity" attribute
     */
    public void xsetTargetEntity(org.apache.xmlbeans.XmlString targetEntity)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGETENTITY$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(TARGETENTITY$10);
            }
            target.set(targetEntity);
        }
    }
    
    /**
     * Unsets the "target-entity" attribute
     */
    public void unsetTargetEntity()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(TARGETENTITY$10);
        }
    }
    
    /**
     * Gets the "fetch" attribute
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType.Enum getFetch()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(FETCH$12);
            if (target == null)
            {
                return null;
            }
            return (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "fetch" attribute
     */
    public com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType xgetFetch()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType)get_store().find_attribute_user(FETCH$12);
            return target;
        }
    }
    
    /**
     * True if has "fetch" attribute
     */
    public boolean isSetFetch()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(FETCH$12) != null;
        }
    }
    
    /**
     * Sets the "fetch" attribute
     */
    public void setFetch(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType.Enum fetch)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(FETCH$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(FETCH$12);
            }
            target.setEnumValue(fetch);
        }
    }
    
    /**
     * Sets (as xml) the "fetch" attribute
     */
    public void xsetFetch(com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType fetch)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType target = null;
            target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType)get_store().find_attribute_user(FETCH$12);
            if (target == null)
            {
                target = (com.googlecode.horncomb.orm.jpa.v10.xmlbeans.FetchType)get_store().add_attribute_user(FETCH$12);
            }
            target.set(fetch);
        }
    }
    
    /**
     * Unsets the "fetch" attribute
     */
    public void unsetFetch()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(FETCH$12);
        }
    }
    
    /**
     * Gets the "mapped-by" attribute
     */
    public java.lang.String getMappedBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MAPPEDBY$14);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "mapped-by" attribute
     */
    public org.apache.xmlbeans.XmlString xgetMappedBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(MAPPEDBY$14);
            return target;
        }
    }
    
    /**
     * True if has "mapped-by" attribute
     */
    public boolean isSetMappedBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(MAPPEDBY$14) != null;
        }
    }
    
    /**
     * Sets the "mapped-by" attribute
     */
    public void setMappedBy(java.lang.String mappedBy)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MAPPEDBY$14);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MAPPEDBY$14);
            }
            target.setStringValue(mappedBy);
        }
    }
    
    /**
     * Sets (as xml) the "mapped-by" attribute
     */
    public void xsetMappedBy(org.apache.xmlbeans.XmlString mappedBy)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(MAPPEDBY$14);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(MAPPEDBY$14);
            }
            target.set(mappedBy);
        }
    }
    
    /**
     * Unsets the "mapped-by" attribute
     */
    public void unsetMappedBy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(MAPPEDBY$14);
        }
    }
}
